﻿@using Abp.Application.Services.Dto
@using Mes5GService.Authorization
@using Mes5GService.Web.Areas.AppAreaName.Models.Roles
@using Mes5GService.Web.Areas.AppAreaName.Startup
@model RoleListViewModel
@{
    ViewBag.CurrentPageName = AppAreaNamePageNames.Common.Roles;
}

@section Scripts
{
    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/role-list.js" asp-append-version="true"></script>
}

<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
    <abp-page-subheader title="@L("Roles")" description="@L("RolesHeaderInfo")">
        @if (IsGranted(AppPermissions.Pages_Administration_Roles_Create))
        {
            <button id="CreateNewRoleButton" class="btn btn-primary">
                <i class="la la-plus"></i> @L("CreateNewRole")
            </button>
        }
    </abp-page-subheader>

    <div class="@(await GetContainerClass())">
        <div class="card card-custom gutter-b">
            <div class="card-body">
                <div class="form">
                    <div class="row mb-4">
                        <div class="col-xl-6">
                            <div class="form-group">
                                <button class="btn btn-default btn-block" id="FilterByPermissionsButton">@L("SelectPermissions") (<span id="NumberOfFilteredPermission">0</span>)</button>
                            </div>
                        </div>
                        <div class="col-xl-6 text-right">
                            <button id="RefreshRolesButton" class="btn btn-primary">
                                <i class="la la-refresh"></i> @L("Refresh")
                            </button>
                        </div>
                    </div>
                </div>
                <div class="align-items-center">
                    <table id="RolesTable" class="display table table-separate table-head-custom no-footer dtr-inline dt-responsive nowrap">
                        <thead>
                        <tr>
                            <th></th>
                            <th>@L("Actions")</th>
                            <th>@L("RoleName")</th>
                            <th>@L("CreationTime")</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
